<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>伪元素选择器before和after</title>
    <style>
      div {
        width: 200px;
        height: 200px;
        background-color: pink;
      }
      /* div::before 权重是2 */
      div::before {
        /* 这个content是必须要写的 */
        content: "我";
        /* before和after都是行内元素，所以不能直接设置宽高，需要转成行内块元素 */
        /* display: inline-block;
            width: 30px;
            height: 40px;
            background-color: purple; */
      }
      div::after {
        content: "小猪佩奇";
      }
    </style>
  </head>
  <body>
    <div>
      是
    </div>
  </body>
</html>
